package com.gz.slin.system.controller;

import com.gz.slin.system.pojo.Menu;
import com.gz.slin.system.service.MenuService;
import org.apache.ibatis.annotations.Param;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by Administrator on 2016/8/15.
 */
@Controller
@RequestMapping("/tree")
public class TreeController {

    private Logger logger = Logger.getLogger(this.getClass());
    @Autowired
    private MenuService menuService;

    @ResponseBody
    @RequestMapping("/list")
    public List<Menu> tree(@Param(value = "nid") Integer nid, HttpServletRequest request) {
        List<Menu> list = menuService.findAllMenuByNid(nid);
        return list;
    }


}
